package com.fingard.dsp.bank.reqrespobj.dsplog;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.dsplog.detail.RetAtsDSPLogDetail;
import com.fingard.xml.XmlTextWriter;

public class RetAtsDSPLog extends RetAtsBase {

	public RetAtsDSPLog(ReqRespHeader p_header){
		retHeader = p_header;
		retXmlWriter = new XmlTextWriter();
	}
	
	public void writeTop(){
		retXmlWriter.writeStartDocument();
		retXmlWriter.writeStartElement("ATSYH");
		retXmlWriter.writeStartElement("TransResp");
		retXmlWriter.writeElementString("TransType", retHeader.transType);
		retXmlWriter.writeElementString("TransSeqID", retHeader.transSeqID);
		retXmlWriter.writeStartElement("TransParam");
	}
	
	public void writeTail(){
		retXmlWriter.writeEndDocument();
	}
	
	public void writeRetDetail(RetAtsDSPLogDetail detail) {
		retXmlWriter.writeStartElement("DetailRecord");
		retXmlWriter.writeElementString("RespCode", detail.respCode);
		retXmlWriter.writeElementString("RespInfo", detail.respInfo);
		retXmlWriter.writeElementString("DspMessage", detail.dspMsg);
		retXmlWriter.writeEndElement();
	}
}
